<?php
session_start();
function asignarCodigo () {
	$string = 'abcdefghijklmnopqrstuvwxyz1234567890';
	$largo = strlen($string)-1;
	$codigo = '';
	for($i=0;$i<32;$i++){
		$codigo .= substr($string,rand(0,$largo),1);
	}
	return $codigo;
}
$_SESSION['cid'] = asignarCodigo();
if (isset($_SESSION['isOpen'])) unset($_SESSION['isOpen']);
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="../../recursos/jquery/jquery-1.9.1.min.js"></script>
<style>
    body {margin: 0; padding: 0; overflow:hidden}
    iframe, embed  {width: 100%; margin: 0; padding: 0; margin: 0 auto}
    @media print {
        iframe, embed{width: 20px; height: 20px} 
    }
</style>
<script>
$(document).ready(function () {
	$('#myIframe').height($(window).height()-5);
})
$(window).resize(function () {
	$('#myIframe').height($(window).height()-5);
})
document.oncontextmenu = function(){return false;}
</script>
</head>
<body>
    <iframe src="../../recursos/pdf.js/viewer/<?php echo($_GET['pdf'].'.pdf#'.$_SESSION['cid']); ?>" id="myIframe"></iframe>
</body>
</html>